#!/usr/bin/env python
# -*- coding:utf-8 -*-

from flask_restful import Api

from . import workerinfo_blueprint
from api_1_0.workerInfoResource.workerInfoResource import WorkerInfoResource
from api_1_0.workerInfoResource.workerInfoOtherResource import WorkerInfoOtherResource

api = Api(workerinfo_blueprint)

api.add_resource(WorkerInfoResource, '/workerInfo/<workerID>', '/workerInfo', endpoint='workerInfo')


# 获取空闲维修师傅路由
@workerinfo_blueprint.route('/workerInfo/freeWorkerInfo', methods=['GET'], endpoint="freeWorkerInfo")
def get_freeWorkerInfo():
    return WorkerInfoOtherResource.get_freeWorkerInfo()


# 添加师傅
@workerinfo_blueprint.route('/workerInfo/addWorkerInfo', methods=['POST'], endpoint="AddWorkerInfo")
def add_worker_info_url():
    return WorkerInfoOtherResource.add_worker()


# 删除师傅
@workerinfo_blueprint.route('/workerInfo/delWorkerInfo', methods=['POST'], endpoint="DelWorkerInfo")
def del_worker_info_url():
    return WorkerInfoOtherResource.del_worker()


# 查找所有师傅
@workerinfo_blueprint.route('/workerInfo/getAllWorker', methods=['GET'], endpoint="GetAllWorker")
def get_all_worker_url():
    return WorkerInfoOtherResource.get_all_worker()
